package edu.sctu.zcy.month201505.subwaysystem.V3;

import java.util.List;

/**
* Created by user24 on 2015/6/4.
*/
public class MonitorSystem {


    public String judgementCriteria = "偷";


    public boolean alert(int i){

        List<Passenger> passengerList = new MetroStation().passengerList;

        boolean is_Thief;
        if (passengerList.get(i).getAction().contains(judgementCriteria)) {

            is_Thief = true;
        }
        else {
            is_Thief = false;
        }
        return is_Thief;
    }

    public void callThePolice(int i) {

        if (alert(i)) {

                System.out.println("警报，有小偷出现");
                System.out.println("小偷此时行为为：" + new MetroStation().passengerList.get(i).getAction());
            } else {
                System.out.println("正常");
            }

        }
    }


